import java.util.LinkedList;
import java.util.Queue;

/**
 * @Author 12629
 * @Description：
 */
public class TestDemo {

    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root =binaryTree.createTree2();
        String ret = binaryTree.tree2str(root);
        System.out.println(ret);
    }


    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("前序遍历");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("中序遍历");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("后序遍历");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("节点的个数1："+ binaryTree.size(root));
        binaryTree.size2(root);
        System.out.println("节点的个数2："+ BinaryTree.nodeSize);
        System.out.println("===============");
        System.out.println("叶子节点个数1："+binaryTree.getLeafNodeCount(root));
        binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点个数2："+BinaryTree.leafSize);
        System.out.println("第K层节点的个数："+binaryTree.getKLevelNodeCount(root,4));
        System.out.println("高度："+binaryTree.getHeight1(root));
        System.out.println("查找节点："+binaryTree.find(root,'E').val);
        System.out.println("===================================");
        System.out.println("层序遍历：");
        binaryTree.levelOrder(root);

        System.out.println("是不是满二叉树：");
        System.out.println(binaryTree.isCompleteTree(root));

        /*Queue<BinaryTree.TreeNode> queue = new LinkedList<>();
        queue.offer(null);
        queue.offer(null);
        queue.offer(null);
        System.out.println(queue.isEmpty());*/
    }
}

